home *** CD-ROM | disk | FTP | other *** search
- /* layout library.h -- Line Layout support routines. */
-
- /* Copyright ©1990, 1991, 1992 Apple Computer, Inc. All rights reserved. */
-
- #ifndef layoutLibraryIncludes
- #define layoutLibraryIncludes
-
- #ifndef graphicsRoutinesIncludes
- #include "graphics routines.h"
- #endif
-
- #ifndef layoutTypesIncludes
- #include "layout types.h"
- #endif
-
- typedef struct {
- gxPriorityJustificationOverride *priorityJustOverride;
- gxGlyphJustificationOverride *glyphJustOverrides;
- long glyphJustOverridesCount;
- gxGlyphSubstitution *glyphSubstitutions;
- long glyphSubstitutionsCount;
- gxKerningAdjustment *kerningAdjustments;
- long kerningAdjustmentsCount;
- } StyleRunOverrides;
-
- typedef struct {
- short nLayouts;
- fixed totalHeight;
- gxShape layouts[];
- } ParagraphRecord, **ParagraphRecordHandle;
-
- typedef struct {
- gxRunFeatureType featureType;
- unsigned short nSelectors;
- unsigned short selectorTableOffset;
- short nameIndex;
- } RunFeatureTypeName;
-
- typedef struct {
- gxRunFeatureSelector featureSelector;
- short nameIndex;
- } RunFeatureSelectorName;
-
- void InitializeRunControls (gxRunControls *runControls);
-
- void InitializeLayoutOptions (gxLayoutOptions *layoutOptions);
-
- void InitializeStyleRunOverrides (StyleRunOverrides *overrides);
-
- void SetDefaultPriorityJustOverride (gxPriorityJustificationOverride *override);
-
- void SetLayoutStyle (
- gxStyle s,
- char *gxFontName,
- fixed textSize,
- gxTextAttribute attr,
- gxRunControls *runControls,
- gxRunFeature runFeatures[],
- long runFeaturesCount,
- StyleRunOverrides *overrides);
-
- gxStyle NewLayoutStyle (
- char *gxFontName,
- fixed textSize,
- gxTextAttribute attr,
- gxRunControls *runControls,
- gxRunFeature runFeatures[],
- long runFeaturesCount,
- StyleRunOverrides *overrides);
-
- gxShape NewSingleLayout (
- char *text,
- char *gxFontName,
- fixed textSize,
- gxLayoutOptions *options,
- gxPoint *position,
- gxTextAttribute attr,
- gxRunControls *runControls,
- gxRunFeature runFeatures[],
- long runFeaturesCount,
- StyleRunOverrides *overrides);
-
- /* The following functions provide a limited paragraph-creation function. They make calls
- to GetWidthArray and do simple gxLine-breaking using the obtained widths.
-
- !!! IMPORTANT NOTE FOLLOWS !!!
-
- These functions need to be able to deal with text in multiple scripts, which might
- contain zero bytes. Therefore calls that determine hard stops (such as NewParagraph)
- do NOT stop at zero bytes; this means that just passing in a single C string is NOT
- sufficient! Callers will need to add a carriage return themselves to the end of the
- text source. */
-
- ParagraphRecordHandle NewParagraph(
- char *text,
- gxStyle baseStyle,
- fixed width,
- long justified, /* really a boolean; this way for compiler difference reasons */
- fixed lineHeight, /* if zero, we will deduce */
- gxPoint *firstOrigin); /* origin of first gxLine in paragraph */
-
- ParagraphRecordHandle NewStyledParagraph(
- long textRunCount,
- const void *text[],
- const short textRunLengths[],
- long styleRunCount,
- const gxStyle styles[],
- const short styleRunLengths[],
- long levelRunCount,
- const short levels[],
- const short levelRunLengths[],
- long totalByteCount,
- const gxLayoutOptions *layoutOptions,
- fixed lineHeight,
- const gxPoint *firstOrigin);
-
- void DisposeParagraph(ParagraphRecordHandle paraRec);
-
- /* GetLayoutBounds can be used to return the bounds of a layout. */
-
- gxShape GetLayoutBounds(gxShape layout);
-
- #endif
-